#include <iostream>
using namespace std;

template <typename T>
T myMax(T a, T b);

template <typename T>
T myMax(T, T, T);

template <typename T>
T myMax(T, T, T, T);

int main() {

    cout << myMax(3, 10) << endl;
    cout << myMax(3, 11, 9) << endl;
    cout << myMax(3, 10, 8, 6) << endl;

    cout << myMax(3.0, 10.0) << endl;
    cout << myMax(3.0, 11.0, 9.0) << endl;
    cout << myMax(3.0, 10.0, 8.0, 6.0) << endl;


    return 0;
}

template <typename T>
T myMax(T value1, T value2) {
    return (value1 > value2) ? value1 : value2;
}

template <typename T>
T myMax(T value1, T value2, T value3) {
    return (myMax(value1, value2) > value3) ? myMax(value1, value2): value3;
}

template <typename T>
T myMax(T value1, T value2, T value3, T value4) {
    return (myMax(value1, value2, value3) > value4) ? myMax(value1, value2, value3) : value4;
}